package test.com.sms.selenium.singlepoint.util;

import org.openqa.selenium.By;

import test.com.sms.selenium.framework.SeleniumPageUtil;
import test.com.sms.selenium.util.SeleniumUtil;

public class SpContractsQuoterItemsListAllPageUtil extends SeleniumPageUtil {
	public final static By CQL_TD_TITLE = By.xpath("//*[@id='Panel0']/table/tbody/tr/td[4]");
	public final static By CQL_SPAN_TITLE = By.id("Quoter_ItemList1_lblScope");
	public final static By CQQ_FILTER_ITEM = By.xpath("//*[@id='Quoter_ItemList1_tblResults']/tbody/tr[2]/td[1]/div/img");
	public final static By CQQ_FILTER_ITEM_CLASS = By.xpath("//*[@id='Quoter_ItemList1_tblResults']/tbody/tr[2]/td[2]/div/img");
	public final static By CQQ_FILTER_SHORT_DESC = By.xpath("//*[@id='Quoter_ItemList1_tblResults']/tbody/tr[2]/td[3]/div/img");
	public final static By CQQ_FILTER_MFG = By.xpath("//*[@id='Quoter_ItemList1_tblResults']/tbody/tr[2]/td[4]/div/img");
	public final static By CQQ_FILTER_REFER = By.xpath("//*[@id='Quoter_ItemList1_tblResults']/tbody/tr[2]/td[5]/div/img");
	public final static By CQQ_FILTER_RATE = By.xpath("//*[@id='Quoter_ItemList1_tblResults']/tbody/tr[2]/td[6]/div/img");
	public final static By CQQ_FILTER_TOP_LEVEL = By.xpath("//*[@id='Quoter_ItemList1_tblResults']/tbody/tr[2]/td[7]/div/img");
	public final static By CQQ_FILTER_QUOTABLE = By.xpath("//*[@id='Quoter_ItemList1_tblResults']/tbody/tr[2]/td[8]/div/img");
	public final static By CQQ_FILTER_BNR = By.xpath("//*[@id='Quoter_ItemList1_tblResults']/tbody/tr[2]/td[9]/div/img");
	public final static By CQQ_FILTER_RNR = By.xpath("//*[@id='Quoter_ItemList1_tblResults']/tbody/tr[2]/td[10]/div/img");
	public final static By CQQ_FILTER_ROLLUP = By.xpath("//*[@id='Quoter_ItemList1_tblResults']/tbody/tr[2]/td[11]/div/img");
	public final static By CQQ_FILTER_PRICE_VIEW = By.xpath("//*[@id='Quoter_ItemList1_tblResults']/tbody/tr[2]/td[12]/div/img");
	public final static By CQL_LINK_ITEM = By.xpath("//*[@id='Quoter_ItemList1_tblResults']/tbody/tr[2]/td[1]/a");
	public final static By CQL_LINK_ITEM_CLASS = By.xpath("//*[@id='Quoter_ItemList1_tblResults']/tbody/tr[2]/td[2]/a");
	public final static By CQL_LINK_SHORT_DESC = By.xpath("//*[@id='Quoter_ItemList1_tblResults']/tbody/tr[2]/td[3]/a");
	public final static By CQL_LINK_MFG = By.xpath("//*[@id='Quoter_ItemList1_tblResults']/tbody/tr[2]/td[4]/a");
	public final static By CQL_LINK_REFER = By.xpath("//*[@id='Quoter_ItemList1_tblResults']/tbody/tr[2]/td[5]/a");
	public final static By CQL_LINK_RATE = By.xpath("//*[@id='Quoter_ItemList1_tblResults']/tbody/tr[2]/td[6]/a");
	public final static By CQL_LINK_WRTY_RATE = By.xpath("//*[@id='Quoter_ItemList1_tblResults']/tbody/tr[2]/td[7]/a");
	public final static By CQL_LINK_TOP_LEVEL = By.xpath("//*[@id='Quoter_ItemList1_tblResults']/tbody/tr[2]/td[8]/a");
	public final static By CQL_LINK_QUOTABLE = By.xpath("//*[@id='Quoter_ItemList1_tblResults']/tbody/tr[2]/td[9]/a");
	public final static By CQL_LINK_BNR = By.xpath("//*[@id='Quoter_ItemList1_tblResults']/tbody/tr[2]/td[10]/a");
	public final static By CQL_LINK_RNR = By.xpath("//*[@id='Quoter_ItemList1_tblResults']/tbody/tr[2]/td[11]/a");
	public final static By CQL_LINK_ROLLUP = By.xpath("//*[@id='Quoter_ItemList1_tblResults']/tbody/tr[2]/td[12]/a");
	public final static By CQL_LINK_PRICE_VIEW = By.xpath("//*[@id='Quoter_ItemList1_tblResults']/tbody/tr[2]/td[13]/a");
	public final static By CQL_LINK_BOM_COUNT = By.xpath("//*[@id='Quoter_ItemList1_tblResults']/tbody/tr[2]/td[14]/a");
	
	public static void enter(){
		SpContractsQuoterPageUtil.enter();
		SpContractsQuoterPageUtil.displayHidenMenus(new By[]{SpContractsQuoterPageUtil.STQ_LINK_ITEM});
		SeleniumUtil.waitOnElements(new By[]{SpContractsQuoterPageUtil.STQ_LINK_ITEM_LISTALL});
		SeleniumUtil.click(SeleniumUtil.getCachedElement(SpContractsQuoterPageUtil.STQ_LINK_ITEM_LISTALL));
		SeleniumUtil.waitForFixedMilliseconds(1000);
		waitForPageToLoad();
	}

	private static void waitForPageToLoad() {
		SeleniumUtil.selectDefaultContent();
		SeleniumUtil.selectFrame(SpHomePageUtil.HOME_FRAME_CONTENT_NAME);
		SeleniumUtil.waitOnElements(new By[]{
				CQL_TD_TITLE,CQL_LINK_BOM_COUNT
		});
	}
}
